<! DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>webgl</title></head>
<style>
    #canvas{
        background: blue;
    }
</style>
<body>
<canvas id="canvas" width="400" height="400">次浏览器不支持canvas</canvas>
<script>
    const ctx = document.getElementById('canvas');
    const c = ctx.getContext('2d');
    c.fillStyle = 'red';
    c.fillRect(300, 10, 100, 100);
</script>
</body>
</html>
